﻿@page
@using Volo.Abp.Account.Localization
@using Volo.Abp.Identity
@using Volo.Abp.Users
@using Microsoft.AspNetCore.Mvc.Localization
@using LINGYUN.Abp.Account.Web.Bundling;
@using LINGYUN.Abp.Account.Web.Pages.Account
@inject IHtmlLocalizer<AccountResource> L
@model LINGYUN.Abp.Account.Web.Pages.Account.ChangePasswordModel

<div class="card mt-3 shadow-sm rounded">
    <div class="card-body p-5">
        <h4>@L["ChangePassword"]</h4>
        <form id="ChangePasswordForm" method="post">
            <input asp-for="ReturnUrl" />
            <input asp-for="ReturnUrlHash" />
            <div class="mb-3">
                @if (!Model.HideOldPasswordInput)
                {
                    <label asp-for="Input.CurrentPassword" class="form-label"></label>
                    <div class="input-group">
                        <input type="password" class="form-control" autocomplete="new-password" maxlength="@IdentityUserConsts.MaxPasswordLength" asp-for="Input.CurrentPassword" />
                        <button class="btn btn-secondary password-visibility-button" type="button"><i class="fa fa-eye-slash" aria-hidden="true"></i></button>
                    </div>
                    <span asp-validation-for="Input.CurrentPassword"></span>

                    <br />
                }
                <label asp-for="Input.NewPassword" class="form-label"></label>
                <div class="input-group">
                    <input type="password" class="form-control" autocomplete="new-password" maxlength="@IdentityUserConsts.MaxPasswordLength" asp-for="Input.NewPassword" />
                    <button class="btn btn-secondary password-visibility-button" type="button"><i class="fa fa-eye-slash" aria-hidden="true"></i></button>
                </div>
                <span asp-validation-for="Input.NewPassword"></span><br />

                <label asp-for="Input.NewPasswordConfirm" class="form-label"></label>
                <div class="input-group">
                    <input type="password" class="form-control" autocomplete="new-password" maxlength="@IdentityUserConsts.MaxPasswordLength" asp-for="Input.NewPasswordConfirm" />
                    <button class="btn btn-secondary password-visibility-button" type="button"><i class="fa fa-eye-slash" aria-hidden="true"></i></button>
                </div>
                <span asp-validation-for="Input.NewPasswordConfirm"></span>
            </div>
            <abp-button type="submit" button-type="Primary" text="@L["Submit"].Value" />
        </form>
    </div>
</div>

<abp-script-bundle name="@AccountBundles.Scripts.ChangePassword" />